﻿using System;
using System.Linq;
using System.Windows;
using Microsoft.Phone.Controls;
using Microsoft.Phone.UserData;

namespace PhoneApp1
{
    public partial class ContactPickerControl : PhoneApplicationPage
    {
        public ContactPickerControl()
        {
            InitializeComponent();
            Contacts contacts = new Contacts();
            contacts.SearchCompleted += (s, ev) =>
            {
                contactPicker1.Items = ev.Results.ToList();
            };
            contacts.SearchAsync(String.Empty, FilterKind.DisplayName, null);
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            contactPicker1.Show();
        }
    }
}